- /* srmrput.cpp by K.Tsuru */
- // function ID = 840 BARDIX
- /*******************************************
- SRational class
- It outputs to the present stream.
- It converts num and den(SInteger) to SLong.
- ********************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- long SRational::Put(int fig, char delmt, int mode) {
- reduce(true);
- long p = 0;
- if(mode & BRACKET){
- num.FPutc('('); p = 2; // ()
- }
- if( den.IsOne() ){ //denominator is one
- p += num.Put(fig, 0, 0, delmt); // SInteger class's menber
- } else {
- p += num.Put(fig, 0, 0, delmt);
- num.FPutc('/'); p++;
- p += den.Put(fig, 0, 0, delmt);
- }
- if(mode & BRACKET) num.FPutc(')');
- if(mode & END_CR){ num.FPutc('\n'); p++; }
- return p;
- }
srmrput.cpp : last modifiled at 2016/06/30 14:51:16(749 bytes)
created at 2016/06/26 15:57:35
The creation time of this html file is 2016/09/18 20:28:05 (Sun Sep 18 20:28:05 2016).